﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace WaterRegimenMonitor.Web.Models
{
    /// <summary>
    /// 用户登陆视图模型。
    /// </summary>
    public class UserLoginViewModel : IValidatableObject
    {
        [Required(ErrorMessage = "请输入用户名!")]
        [StringLength(32, ErrorMessage = "用户名长度不超过32位!")]
        public string UserName { get; set; }

        [Required(ErrorMessage = "请输入密码!")]
        [StringLength(64, ErrorMessage = "密码长度不超过64位!")]
        public string Password { get; set; }

        public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        {
            return new List<ValidationResult>();
        }
    }
}
